<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Glulx and Glk</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Glulx and Glk' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../extensions.html">Extensions</a></li><li><a href="index.html">Basic Inform</a></li><li><b>Glulx and Glk</b></li></ul></div>
<p class="purpose">Support for Glulx and Glk interpreter systems.</p>

<ul class="toc"><li><a href="gag.html#SP2">&#167;2. Version numbering</a></li><li><a href="gag.html#SP3">&#167;3. Feature testing</a></li><li><a href="gag.html#SP4">&#167;4. Glk windows</a></li><li><a href="gag.html#SP7">&#167;7. Basic window functions</a></li><li><a href="gag.html#SP8">&#167;8. Glk events</a></li><li><a href="gag.html#SP10">&#167;10. Suspending input</a></li><li><a href="gag.html#SP11">&#167;11. Glk object recovery</a></li></ul><hr class="tocbar">

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">Part</span><span class="plain-syntax"> </span><span class="identifier-syntax">Four</span><span class="plain-syntax"> - </span><span class="identifier-syntax">Glulx</span><span class="plain-syntax"> </span><span class="identifier-syntax">and</span><span class="plain-syntax"> </span><span class="identifier-syntax">Glk</span><span class="plain-syntax"> (</span><span class="identifier-syntax">for</span><span class="plain-syntax"> </span><span class="identifier-syntax">Glulx</span><span class="plain-syntax"> </span><span class="identifier-syntax">only</span><span class="plain-syntax">)</span>
</pre>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. Version numbering.</b></p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">Chapter</span><span class="plain-syntax"> - </span><span class="identifier-syntax">Version</span><span class="plain-syntax"> </span><span class="identifier-syntax">numbers</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">which</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">major</span><span class="plain-syntax"> </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">V</span><span class="plain-syntax"> - </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- (</span><span class="identifier-syntax">VERSION_NUMBER_TY_Extract</span><span class="plain-syntax">({</span><span class="identifier-syntax">V</span><span class="plain-syntax">}, </span><span class="constant-syntax">0</span><span class="plain-syntax">)) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">which</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">minor</span><span class="plain-syntax"> </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">V</span><span class="plain-syntax"> - </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- (</span><span class="identifier-syntax">VERSION_NUMBER_TY_Extract</span><span class="plain-syntax">({</span><span class="identifier-syntax">V</span><span class="plain-syntax">}, </span><span class="constant-syntax">1</span><span class="plain-syntax">)) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">which</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">patch</span><span class="plain-syntax"> </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">V</span><span class="plain-syntax"> - </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- (</span><span class="identifier-syntax">VERSION_NUMBER_TY_Extract</span><span class="plain-syntax">({</span><span class="identifier-syntax">V</span><span class="plain-syntax">}, </span><span class="constant-syntax">2</span><span class="plain-syntax">)) -).</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. Feature testing.</b>These phrases let us test for various interpreter features.
While most features can use the generic functions, a few need special handling,
and so individual phrases are defined for them.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">Chapter</span><span class="plain-syntax"> - </span><span class="identifier-syntax">Glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">and</span><span class="plain-syntax"> </span><span class="identifier-syntax">Glulx</span><span class="plain-syntax"> </span><span class="identifier-syntax">feature</span><span class="plain-syntax"> </span><span class="identifier-syntax">testing</span>

<span class="identifier-syntax">Definition</span><span class="plain-syntax">: </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">feature</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">supported</span><span class="plain-syntax"> </span><span class="identifier-syntax">rather</span><span class="plain-syntax"> </span><span class="identifier-syntax">than</span><span class="plain-syntax"> </span><span class="identifier-syntax">unsupported</span><span class="plain-syntax"> </span><span class="identifier-syntax">if</span><span class="plain-syntax"> </span><span class="identifier-syntax">I6</span><span class="plain-syntax"> </span><span class="identifier-syntax">routine</span>
<span class="plain-syntax">    "</span><span class="identifier-syntax">GlkFeatureTest</span><span class="plain-syntax">" </span><span class="identifier-syntax">says</span><span class="plain-syntax"> </span><span class="identifier-syntax">so</span><span class="plain-syntax"> (</span><span class="identifier-syntax">it</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">supported</span><span class="plain-syntax"> </span><span class="identifier-syntax">by</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">interpreter</span><span class="plain-syntax">).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">/--</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glkversion</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">VERSION_NUMBER_TY_NewFromPacked</span><span class="plain-syntax">(</span><span class="identifier-syntax">Cached_Glk_Gestalts</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">gestalt_Version</span><span class="plain-syntax">) -).</span>

<span class="identifier-syntax">Definition</span><span class="plain-syntax">: </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glulx</span><span class="plain-syntax"> </span><span class="identifier-syntax">feature</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">supported</span><span class="plain-syntax"> </span><span class="identifier-syntax">rather</span><span class="plain-syntax"> </span><span class="identifier-syntax">than</span><span class="plain-syntax"> </span><span class="identifier-syntax">unsupported</span><span class="plain-syntax"> </span><span class="identifier-syntax">if</span><span class="plain-syntax"> </span><span class="identifier-syntax">I6</span><span class="plain-syntax"> </span><span class="identifier-syntax">routine</span>
<span class="plain-syntax">    "</span><span class="identifier-syntax">GlulxFeatureTest</span><span class="plain-syntax">" </span><span class="identifier-syntax">says</span><span class="plain-syntax"> </span><span class="identifier-syntax">so</span><span class="plain-syntax"> (</span><span class="identifier-syntax">it</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">supported</span><span class="plain-syntax"> </span><span class="identifier-syntax">by</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">interpreter</span><span class="plain-syntax">).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">glulx</span><span class="plain-syntax"> </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">/--:</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">VERSION_NUMBER_TY_NewFromPacked</span><span class="plain-syntax">(</span><span class="identifier-syntax">Cached_Glulx_Gestalts</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">GLULX_GESTALT_GlulxVersion</span><span class="plain-syntax">) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">interpreter</span><span class="plain-syntax"> </span><span class="identifier-syntax">version</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">/--:</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">VERSION_NUMBER_TY_NewFromPacked</span><span class="plain-syntax">(</span><span class="identifier-syntax">Cached_Glulx_Gestalts</span><span class="plain-syntax">--&gt;</span><span class="identifier-syntax">GLULX_GESTALT_TerpVersion</span><span class="plain-syntax">) -).</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. Glk windows.</b>Minimal support for Glk windows. Other extensions may extend the kind.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">Chapter</span><span class="plain-syntax"> - </span><span class="identifier-syntax">Glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">windows</span>

<span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">Glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">abstract</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">K_Glk_Window</span><span class="plain-syntax">".</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">specification</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> "</span><span class="identifier-syntax">Models</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">Glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">system</span><span class="plain-syntax">."</span>

<span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">has</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> </span><span class="identifier-syntax">called</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> </span><span class="identifier-syntax">property</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">glk_window_type</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">has</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">called</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">rock</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">rock</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">property</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">glk_rock</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">has</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">called</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">handle</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">handle</span><span class="plain-syntax"> </span><span class="identifier-syntax">property</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">glk_ref</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">Definition</span><span class="plain-syntax">: </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">on</span><span class="plain-syntax">-</span><span class="identifier-syntax">screen</span><span class="plain-syntax"> </span><span class="identifier-syntax">rather</span><span class="plain-syntax"> </span><span class="identifier-syntax">than</span><span class="plain-syntax"> </span><span class="identifier-syntax">off</span><span class="plain-syntax">-</span><span class="identifier-syntax">screen</span><span class="plain-syntax"> </span><span class="identifier-syntax">if</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">handle</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">it</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">not</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span><span class="plain-syntax">.</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>Setting window types is quite verbose, so we have some subkinds to make it easier.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">graphics</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">graphics</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">graphics</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">buffer</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">buffer</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">buffer</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">grid</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">kind</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">grid</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">grid</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax">.</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>Create objects for each of the built in windows.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">main</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">buffer</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">main</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">Main_Window</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">status</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">grid</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">status</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">Status_Window</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">quote</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">buffer</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">quote</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">Quote_Window</span><span class="plain-syntax">".</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. Basic window functions.</b>Some basic Glk window functions will be supported out of the box, but others will
require extensions.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">Section</span><span class="plain-syntax"> - </span><span class="identifier-syntax">Glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">windows</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">clear</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glkwindowclear</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">WindowClear</span><span class="plain-syntax">({</span><span class="identifier-syntax">win</span><span class="plain-syntax">}); -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">focus</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glkwindowfocus</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">WindowFocus</span><span class="plain-syntax">({</span><span class="identifier-syntax">win</span><span class="plain-syntax">}); -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">height</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glkwindowheight</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">WindowGetSize</span><span class="plain-syntax">({</span><span class="identifier-syntax">win</span><span class="plain-syntax">}, </span><span class="constant-syntax">1</span><span class="plain-syntax">) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">width</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glkwindowwidth</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">WindowGetSize</span><span class="plain-syntax">({</span><span class="identifier-syntax">win</span><span class="plain-syntax">}, </span><span class="constant-syntax">0</span><span class="plain-syntax">) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">set</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">) </span><span class="identifier-syntax">cursor</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">row</span><span class="plain-syntax"> (</span><span class="identifier-syntax">row</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">) </span><span class="identifier-syntax">and</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">column</span><span class="plain-syntax">/</span><span class="identifier-syntax">col</span><span class="plain-syntax"> (</span><span class="identifier-syntax">col</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glksetcursor</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">WindowMoveCursor</span><span class="plain-syntax">({</span><span class="identifier-syntax">win</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">col</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">row</span><span class="plain-syntax">}); -).</span>
</pre>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. Glk events.</b>Glk events can be handled with the glk event handling rules.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">Chapter</span><span class="plain-syntax"> - </span><span class="identifier-syntax">Glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">events</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> (</span><span class="identifier-syntax">evtype</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax">) </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">:</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">evtype</span><span class="plain-syntax">}) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">character</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">with</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> - </span><span class="identifier-syntax">unicode</span><span class="plain-syntax"> </span><span class="identifier-syntax">character</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_CharInput</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="identifier-syntax">MapUnicodeToGlkKeyCode</span><span class="plain-syntax">({</span><span class="identifier-syntax">C</span><span class="plain-syntax">})) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">character</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">with</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> - </span><span class="identifier-syntax">unicode</span><span class="plain-syntax"> </span><span class="identifier-syntax">character</span><span class="plain-syntax">) </span><span class="identifier-syntax">in</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glkcharacterevent</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_CharInput</span><span class="plain-syntax">, {</span><span class="identifier-syntax">win</span><span class="plain-syntax">}, </span><span class="identifier-syntax">MapUnicodeToGlkKeyCode</span><span class="plain-syntax">({</span><span class="identifier-syntax">C</span><span class="plain-syntax">})) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">line</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">with</span><span class="plain-syntax"> (</span><span class="identifier-syntax">T</span><span class="plain-syntax"> - </span><span class="identifier-syntax">text</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_LineInput</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, {-</span><span class="identifier-syntax">by</span><span class="plain-syntax">-</span><span class="identifier-syntax">reference</span><span class="plain-syntax">:</span><span class="identifier-syntax">T</span><span class="plain-syntax">}) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">line</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">with</span><span class="plain-syntax"> (</span><span class="identifier-syntax">T</span><span class="plain-syntax"> - </span><span class="identifier-syntax">text</span><span class="plain-syntax">) </span><span class="identifier-syntax">in</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glklineevent</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_LineInput</span><span class="plain-syntax">, {</span><span class="identifier-syntax">win</span><span class="plain-syntax">}, </span><span class="constant-syntax">0</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, {-</span><span class="identifier-syntax">by</span><span class="plain-syntax">-</span><span class="identifier-syntax">reference</span><span class="plain-syntax">:</span><span class="identifier-syntax">T</span><span class="plain-syntax">}) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">mouse</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">for</span><span class="plain-syntax">/</span><span class="identifier-syntax">of</span><span class="plain-syntax">/</span><span class="identifier-syntax">with</span><span class="plain-syntax"> </span><span class="identifier-syntax">x</span><span class="plain-syntax"> (</span><span class="identifier-syntax">x</span><span class="plain-syntax"> - </span><span class="identifier-syntax">number</span><span class="plain-syntax">) </span><span class="identifier-syntax">and</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">y</span><span class="plain-syntax"> (</span><span class="identifier-syntax">y</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">) </span><span class="identifier-syntax">coordinates</span><span class="plain-syntax">/--:</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_MouseInput</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, {</span><span class="identifier-syntax">x</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">y</span><span class="plain-syntax">}) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">mouse</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">for</span><span class="plain-syntax">/</span><span class="identifier-syntax">of</span><span class="plain-syntax">/</span><span class="identifier-syntax">with</span><span class="plain-syntax"> </span><span class="identifier-syntax">x</span><span class="plain-syntax"> (</span><span class="identifier-syntax">x</span><span class="plain-syntax"> - </span><span class="identifier-syntax">number</span><span class="plain-syntax">) </span><span class="identifier-syntax">and</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">y</span><span class="plain-syntax"> (</span><span class="identifier-syntax">y</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">) </span><span class="identifier-syntax">coordinates</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">in</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_MouseInput</span><span class="plain-syntax">, {</span><span class="identifier-syntax">win</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">x</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">y</span><span class="plain-syntax">}) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">mouse</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">for</span><span class="plain-syntax">/</span><span class="identifier-syntax">of</span><span class="plain-syntax">/</span><span class="identifier-syntax">with</span><span class="plain-syntax"> </span><span class="identifier-syntax">row</span><span class="plain-syntax"> (</span><span class="identifier-syntax">y</span><span class="plain-syntax"> - </span><span class="identifier-syntax">number</span><span class="plain-syntax">) </span><span class="identifier-syntax">and</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">column</span><span class="plain-syntax">/</span><span class="identifier-syntax">col</span><span class="plain-syntax"> (</span><span class="identifier-syntax">x</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_MouseInput</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, {</span><span class="identifier-syntax">x</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">y</span><span class="plain-syntax">}) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">mouse</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">for</span><span class="plain-syntax">/</span><span class="identifier-syntax">of</span><span class="plain-syntax">/</span><span class="identifier-syntax">with</span><span class="plain-syntax"> </span><span class="identifier-syntax">row</span><span class="plain-syntax"> (</span><span class="identifier-syntax">y</span><span class="plain-syntax"> - </span><span class="identifier-syntax">number</span><span class="plain-syntax">) </span><span class="identifier-syntax">and</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">column</span><span class="plain-syntax">/</span><span class="identifier-syntax">col</span><span class="plain-syntax"> (</span><span class="identifier-syntax">x</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax">) </span><span class="identifier-syntax">in</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_MouseInput</span><span class="plain-syntax">, {</span><span class="identifier-syntax">win</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">x</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">y</span><span class="plain-syntax">}) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">hyperlink</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">for</span><span class="plain-syntax">/</span><span class="identifier-syntax">of</span><span class="plain-syntax">/</span><span class="identifier-syntax">with</span><span class="plain-syntax"> (</span><span class="identifier-syntax">val</span><span class="plain-syntax"> - </span><span class="identifier-syntax">number</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_Hyperlink</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, {</span><span class="identifier-syntax">val</span><span class="plain-syntax">}) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax">/-- </span><span class="identifier-syntax">hyperlink</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">for</span><span class="plain-syntax">/</span><span class="identifier-syntax">of</span><span class="plain-syntax">/</span><span class="identifier-syntax">with</span><span class="plain-syntax"> (</span><span class="identifier-syntax">val</span><span class="plain-syntax"> - </span><span class="identifier-syntax">number</span><span class="plain-syntax">) </span><span class="identifier-syntax">in</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_New</span><span class="plain-syntax">({-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_Hyperlink</span><span class="plain-syntax">, {</span><span class="identifier-syntax">win</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">val</span><span class="plain-syntax">}) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ev</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glkeventtype</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_Type</span><span class="plain-syntax">({</span><span class="identifier-syntax">ev</span><span class="plain-syntax">}) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ev</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glkeventwindow</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_Window</span><span class="plain-syntax">({</span><span class="identifier-syntax">ev</span><span class="plain-syntax">}) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">unicode</span><span class="plain-syntax"> </span><span class="identifier-syntax">character</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">character</span><span class="plain-syntax"> </span><span class="identifier-syntax">value</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ev</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glkeventcharactervalue</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_Value1</span><span class="plain-syntax">({</span><span class="identifier-syntax">ev</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_CharInput</span><span class="plain-syntax">) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">x</span><span class="plain-syntax"> </span><span class="identifier-syntax">coordinate</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ev</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_Value1</span><span class="plain-syntax">({</span><span class="identifier-syntax">ev</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_MouseInput</span><span class="plain-syntax">) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">y</span><span class="plain-syntax"> </span><span class="identifier-syntax">coordinate</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ev</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_Value2</span><span class="plain-syntax">({</span><span class="identifier-syntax">ev</span><span class="plain-syntax">}) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">row</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ev</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_Value2</span><span class="plain-syntax">({</span><span class="identifier-syntax">ev</span><span class="plain-syntax">}) -).</span>
<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">column</span><span class="plain-syntax">/</span><span class="identifier-syntax">col</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ev</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_Value1</span><span class="plain-syntax">({</span><span class="identifier-syntax">ev</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_MouseInput</span><span class="plain-syntax">) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">hyperlink</span><span class="plain-syntax"> </span><span class="identifier-syntax">value</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ev</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_Value1</span><span class="plain-syntax">({</span><span class="identifier-syntax">ev</span><span class="plain-syntax">}, </span><span class="identifier-syntax">evtype_Hyperlink</span><span class="plain-syntax">) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ev</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">documented</span><span class="plain-syntax"> </span><span class="identifier-syntax">at</span><span class="plain-syntax"> </span><span class="identifier-syntax">ph_glkeventtextvalue</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_Text</span><span class="plain-syntax">({</span><span class="identifier-syntax">ev</span><span class="plain-syntax">}, {-</span><span class="identifier-syntax">new</span><span class="plain-syntax">: </span><span class="identifier-syntax">text</span><span class="plain-syntax">}) -).</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>And now the glk event handling rules themselves.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">handling</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span><span class="plain-syntax"> </span><span class="identifier-syntax">based</span><span class="plain-syntax"> </span><span class="identifier-syntax">rulebook</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">handling</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">GLK_EVENT_HANDLING_RB</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">handling</span><span class="plain-syntax"> </span><span class="identifier-syntax">rulebook</span><span class="plain-syntax"> </span><span class="identifier-syntax">has</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">called</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">.</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">current</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">initialiser</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">variable</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">current</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">initialiser</span><span class="plain-syntax"> </span><span class="identifier-syntax">variable</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">defined</span><span class="plain-syntax"> </span><span class="identifier-syntax">by</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">current_glk_event</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">Very</span><span class="plain-syntax"> </span><span class="identifier-syntax">first</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">handling</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">for</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">type</span>
<span class="plain-syntax">    (</span><span class="identifier-syntax">this</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">set</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">processing</span><span class="plain-syntax"> </span><span class="identifier-syntax">variables</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">now</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">current</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">initialiser</span><span class="plain-syntax">.</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">handle</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ev</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">GLK_EVENT_TY_Handle_Instead</span><span class="plain-syntax">({</span><span class="identifier-syntax">ev</span><span class="plain-syntax">}); </span><span class="identifier-syntax">rtrue</span><span class="plain-syntax">; -).</span>

<span class="identifier-syntax">Glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> </span><span class="identifier-syntax">handling</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">for</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">screen</span><span class="plain-syntax"> </span><span class="identifier-syntax">resize</span><span class="plain-syntax"> </span><span class="identifier-syntax">event</span><span class="plain-syntax"> (</span><span class="identifier-syntax">this</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">redraw</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">status</span><span class="plain-syntax"> </span><span class="identifier-syntax">line</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">redraw</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">status</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">;</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. Suspending input.</b>These properties and phrases allow the author to suspend and resume input requests.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">Chapter</span><span class="plain-syntax"> - </span><span class="identifier-syntax">Suspending</span><span class="plain-syntax"> </span><span class="identifier-syntax">and</span><span class="plain-syntax"> </span><span class="identifier-syntax">resuming</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span>

<span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">has</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax"> </span><span class="identifier-syntax">status</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax"> </span><span class="identifier-syntax">status</span><span class="plain-syntax"> </span><span class="identifier-syntax">property</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">text_input_status</span><span class="plain-syntax">".</span>
<span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">can</span><span class="plain-syntax"> </span><span class="identifier-syntax">be</span><span class="plain-syntax"> </span><span class="identifier-syntax">requesting</span><span class="plain-syntax"> </span><span class="identifier-syntax">hyperlink</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">requesting</span><span class="plain-syntax"> </span><span class="identifier-syntax">hyperlink</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax"> </span><span class="identifier-syntax">property</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">requesting_hyperlink</span><span class="plain-syntax">".</span>
<span class="identifier-syntax">A</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax"> </span><span class="identifier-syntax">can</span><span class="plain-syntax"> </span><span class="identifier-syntax">be</span><span class="plain-syntax"> </span><span class="identifier-syntax">requesting</span><span class="plain-syntax"> </span><span class="identifier-syntax">mouse</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">requesting</span><span class="plain-syntax"> </span><span class="identifier-syntax">mouse</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax"> </span><span class="identifier-syntax">property</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">requesting_mouse</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">suspend</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">), </span><span class="identifier-syntax">without</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax"> </span><span class="identifier-syntax">echoing</span><span class="plain-syntax">:</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">SuspendTextInput</span><span class="plain-syntax">({</span><span class="identifier-syntax">win</span><span class="plain-syntax">}, {</span><span class="identifier-syntax">phrase</span><span class="plain-syntax"> </span><span class="identifier-syntax">options</span><span class="plain-syntax">}); -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">resume</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> (</span><span class="identifier-syntax">win</span><span class="plain-syntax"> - </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">ResumeTextInput</span><span class="plain-syntax">({</span><span class="identifier-syntax">win</span><span class="plain-syntax">}); -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">decide</span><span class="plain-syntax"> </span><span class="identifier-syntax">what</span><span class="plain-syntax"> </span><span class="identifier-syntax">text</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">current</span><span class="plain-syntax"> </span><span class="identifier-syntax">line</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">w</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">WindowBufferCopyToText</span><span class="plain-syntax">({</span><span class="identifier-syntax">w</span><span class="plain-syntax">}, {-</span><span class="identifier-syntax">new</span><span class="plain-syntax">:</span><span class="identifier-syntax">text</span><span class="plain-syntax">}) -).</span>

<span class="identifier-syntax">To</span><span class="plain-syntax"> </span><span class="identifier-syntax">set</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">current</span><span class="plain-syntax"> </span><span class="identifier-syntax">line</span><span class="plain-syntax"> </span><span class="identifier-syntax">input</span><span class="plain-syntax"> </span><span class="identifier-syntax">of</span><span class="plain-syntax"> (</span><span class="identifier-syntax">w</span><span class="plain-syntax"> - </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">window</span><span class="plain-syntax">) </span><span class="identifier-syntax">to</span><span class="plain-syntax"> (</span><span class="identifier-syntax">t</span><span class="plain-syntax"> - </span><span class="identifier-syntax">text</span><span class="plain-syntax">):</span>
<span class="plain-syntax">    (- </span><span class="identifier-syntax">WindowBufferSet</span><span class="plain-syntax">({</span><span class="identifier-syntax">w</span><span class="plain-syntax">}, {-</span><span class="identifier-syntax">by</span><span class="plain-syntax">-</span><span class="identifier-syntax">reference</span><span class="plain-syntax">:</span><span class="identifier-syntax">t</span><span class="plain-syntax">}); -).</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. Glk object recovery.</b>These rules are a low level system for managing Glk references. When a Glulx
game restarts and restores, the current Glk IO state is not reset. All the old
windows, sound channels etc. will be kept as they were, even though the game file
might be expecting a different state. This extension allows Inform 7 game files
to ensure that the IO state is as it should be. It does this in three stages:
</p>

<ul class="items"><li>(a) The "reset glk references rules" is run. Rules should be added to reset all
Glk references as if none existed.
</li><li>(b) The "identify glk windows rules" etc. are run. These rulebooks will be run
once for each Glk IO object which currently exists. Objects can be identified
through the current glk object rock number and current glk object reference
number variables.
</li><li>(c) The "glk object updating rules" is run. Rules should be added to correct the
Glk IO state by, for example, closing windows which shouldn't exist, and opening
windows which should but currently do not.
</li></ul>
<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">Chapter</span><span class="plain-syntax"> - </span><span class="identifier-syntax">Glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">recovery</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">current</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">rock</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">that</span><span class="plain-syntax"> </span><span class="identifier-syntax">varies</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">current</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">rock</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">variable</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">current_glk_object_rock</span><span class="plain-syntax">".</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">current</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">reference</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">that</span><span class="plain-syntax"> </span><span class="identifier-syntax">varies</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">current</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">reference</span><span class="plain-syntax"> </span><span class="identifier-syntax">number</span><span class="plain-syntax"> </span><span class="identifier-syntax">variable</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">current_glk_object_reference</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">reset</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">references</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">rulebook</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">reset</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">references</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">RESET_GLK_REFERENCES_RB</span><span class="plain-syntax">".</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">windows</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">rulebook</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">windows</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">IDENTIFY_WINDOWS_RB</span><span class="plain-syntax">".</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">streams</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">rulebook</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">streams</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">IDENTIFY_STREAMS_RB</span><span class="plain-syntax">".</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">filerefs</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">rulebook</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">filerefs</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">IDENTIFY_FILEREFS_RB</span><span class="plain-syntax">".</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">sound</span><span class="plain-syntax"> </span><span class="identifier-syntax">channels</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">rulebook</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">sound</span><span class="plain-syntax"> </span><span class="identifier-syntax">channels</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">IDENTIFY_SCHANNELS_RB</span><span class="plain-syntax">".</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">updating</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">a</span><span class="plain-syntax"> </span><span class="identifier-syntax">rulebook</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">updating</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">accessible</span><span class="plain-syntax"> </span><span class="identifier-syntax">to</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">GLK_OBJECT_UPDATING_RB</span><span class="plain-syntax">".</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. </b>And the standard rules, which may be replaced by extensions.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">reset</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">references</span><span class="plain-syntax"> </span><span class="identifier-syntax">for</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">objects</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">listed</span><span class="plain-syntax"> </span><span class="identifier-syntax">first</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">reset</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">references</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">reset</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">references</span><span class="plain-syntax"> </span><span class="identifier-syntax">for</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">objects</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">RESET_GLK_REFERENCES_R</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">cache</span><span class="plain-syntax"> </span><span class="identifier-syntax">gestalts</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">listed</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">reset</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">references</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">cache</span><span class="plain-syntax"> </span><span class="identifier-syntax">gestalts</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">CACHE_GESTALTS_R</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">windows</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">listed</span><span class="plain-syntax"> </span><span class="identifier-syntax">first</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">windows</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">windows</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">IDENTIFY_WINDOWS_R</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">streams</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">listed</span><span class="plain-syntax"> </span><span class="identifier-syntax">first</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">streams</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">streams</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">IDENTIFY_STREAMS_R</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">filerefs</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">listed</span><span class="plain-syntax"> </span><span class="identifier-syntax">first</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">filerefs</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">filerefs</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">IDENTIFY_FILEREFS_R</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">sound</span><span class="plain-syntax"> </span><span class="identifier-syntax">channels</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">listed</span><span class="plain-syntax"> </span><span class="identifier-syntax">first</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">sound</span><span class="plain-syntax"> </span><span class="identifier-syntax">channels</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">identify</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">sound</span><span class="plain-syntax"> </span><span class="identifier-syntax">channels</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">IDENTIFY_SCHANNELS_R</span><span class="plain-syntax">".</span>

<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">stop</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">sound</span><span class="plain-syntax"> </span><span class="identifier-syntax">channels</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">is</span><span class="plain-syntax"> </span><span class="identifier-syntax">listed</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">the</span><span class="plain-syntax"> </span><span class="identifier-syntax">glk</span><span class="plain-syntax"> </span><span class="identifier-syntax">object</span><span class="plain-syntax"> </span><span class="identifier-syntax">updating</span><span class="plain-syntax"> </span><span class="identifier-syntax">rules</span><span class="plain-syntax">.</span>
<span class="identifier-syntax">The</span><span class="plain-syntax"> </span><span class="identifier-syntax">stop</span><span class="plain-syntax"> </span><span class="identifier-syntax">built</span><span class="plain-syntax"> </span><span class="identifier-syntax">in</span><span class="plain-syntax"> </span><span class="identifier-syntax">sound</span><span class="plain-syntax"> </span><span class="identifier-syntax">channels</span><span class="plain-syntax"> </span><span class="identifier-syntax">rule</span><span class="plain-syntax"> </span><span class="identifier-syntax">translates</span><span class="plain-syntax"> </span><span class="identifier-syntax">into</span><span class="plain-syntax"> </span><span class="identifier-syntax">Inter</span><span class="plain-syntax"> </span><span class="identifier-syntax">as</span><span class="plain-syntax"> "</span><span class="identifier-syntax">STOP_SCHANNELS_R</span><span class="plain-syntax">".</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="phdf.html">&#10094;</a></li><li class="progresssection"><a href="prmbl.html">prmbl</a></li><li class="progresssection"><a href="msdf.html">msdf</a></li><li class="progresssection"><a href="phdf.html">phdf</a></li><li class="progresscurrent">gag</li><li class="progresssection"><a href="addf.html">addf</a></li><li class="progressnext"><a href="addf.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

